package com.innovation.chengzhangriji.http;

import com.google.gson.annotations.SerializedName;
import com.innovation.library.http.InnovationRequestBody;

public class RefreshTokenRequest extends BaseRequest {

    public static final String PATH = BaseRequest.PATH + "api/refresh_token";

    private String phoneNum;

    private String token;

    public String getPhoneNum() {
        return phoneNum;
    }

    public void setPhoneNum(String phoneNum) {
        this.phoneNum = phoneNum;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    @Override
    protected InnovationRequestBody getInnovationRequestBody() {
        RefreshTokenRequestBody body = new RefreshTokenRequestBody();
        body.setPhoneNum(phoneNum);
        body.setToken(token);
        return body;
    }

    private class RefreshTokenRequestBody extends BaseRequestBody {

        @SerializedName("UN")
        private String phoneNum;

        @SerializedName("RefreshToken")
        private String token;

        private RefreshTokenRequestBody() {
            setSv(BaseRequestConfig.SV_REFRESH_TOKEN);
        }

        public String getPhoneNum() {
            return phoneNum;
        }

        public void setPhoneNum(String phoneNum) {
            this.phoneNum = phoneNum;
        }

        public String getToken() {
            return token;
        }

        public void setToken(String token) {
            this.token = token;
        }
    }
}
